a11y(3.3.1): Holocene input primitives — add aria-invalid, aria-describedby, and uniform live-region error announcement#3554
Open
rosanusi wants to merge 1 commit into
Conversation
…l seven Holocene input primitives
Adds uniform error-association across Input, Textarea, NumberInput, ChipInput,
Combobox, Select, and Checkbox so screen-reader users hear the error text when
focus returns to an invalid field.
Each primitive now:
- Sets aria-invalid="true" on the underlying control when an error is active
- Generates a unique errorId from the consumer-supplied id prop and sets
aria-describedby pointing at the error element (only when an error is present)
- Renders the error text element with id={errorId} and role="alert" for
consistent live-region announcement across all seven primitives
A11y-Audit-Ref: 3.3.1-holocene-input-primitives-error-association
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -123,6 +123,9 @@ | |||
| // After all the Options are mounted use context to read the label assocaited with the value | |||
Contributor
There was a problem hiding this comment.
⚠️ Argument of type 'T | undefined' is not assignable to parameter of type 'T'.
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds uniform error-association to all seven Holocene input primitives (
Input,Textarea,NumberInput,ChipInput,Combobox,Select,Checkbox).Each primitive now:
aria-invalid="true"on the underlying control when an error is activeerrorId(${id}-error) per instance and setsaria-describedbypointing at the error element (only when an error is present — no dangling references)id={errorId}androle="alert"for consistent live-region announcementThis ensures screen-reader users hear the error text both on first render (live region) and when focus returns to an invalid field (via
aria-describedbyassociation).Before: AT reads only the field label when focus returns to an invalid field; user cannot detect the error state programmatically.
After: AT announces field label + "invalid entry, [error text]" via
aria-invalid+aria-describedby.Files changed
src/lib/holocene/input/input.sveltesrc/lib/holocene/textarea.sveltesrc/lib/holocene/input/number-input.sveltesrc/lib/holocene/input/chip-input.sveltesrc/lib/holocene/combobox/combobox.sveltesrc/lib/holocene/select/select.sveltesrc/lib/holocene/checkbox.svelteTest plan
aria-invalid="true"on the control,id="{id}-error"on the error element,aria-describedby="{id}-error"on the control, androle="alert"on the error elementaria-describedbyis set when no error is present (no dangling references)hintTextstill displays correctly whenerror=false/valid=trueReferences
3.3.1-holocene-input-primitives-error-association🤖 Generated with Claude Code
A11y-Audit-Ref: 3.3.1-holocene-input-primitives-error-association